export function gotoTop() {
	document.documentElement.scrollTop = 0;
	window.pageYOffset = 0;
	document.body.scrollTop = 0;
}
export function getUrlKey(name){

  let authKey = decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
  if(!authKey){
    authKey = window.localStorage.getItem('authKey');
  }else{
    window.localStorage.setItem('authKey',authKey);
  }
  if(authKey === 'null'){
    alert('auth 为空')
  }
  return authKey
}
export function showSelOption(element){
  if (document.createEvent) {
    let e = document.createEvent("MouseEvents");
    e.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
    element.dispatchEvent(e);
  } else if (element.fireEvent) {
    element.fireEvent("onmousedown");
  }
}

